import request from './request'

/**
 * Offspring tracking related API
 */
export const offspringAPI = {
  /**
   * Get offspring tracking list
   * @param {Object} params - Query parameters
   */
  getList(params) {
    return request({
      url: '/offspring',
      method: 'get',
      params
    })
  },

  /**
   * Get offspring details
   * @param {number} id - Offspring ID
   */
  getDetail(id) {
    return request({
      url: `/offspring/${id}`,
      method: 'get'
    })
  },

  /**
   * Create offspring record
   * @param {Object} data - Offspring information
   */
  create(data) {
    return request({
      url: '/offspring',
      method: 'post',
      data
    })
  },

  /**
   * Update offspring record
   * @param {number} id - Offspring ID
   * @param {Object} data - Updated information
   */
  update(id, data) {
    return request({
      url: `/offspring/${id}`,
      method: 'put',
      data
    })
  },

  /**
   * Delete offspring record
   * @param {number} id - Offspring ID
   */
  delete(id) {
    return request({
      url: `/offspring/${id}`,
      method: 'delete'
    })
  }
}
